* Master file
clear all
set more off

*****************************************************************************
* TO REPRODUCE THE ANALYSIS, PLEASE CHANGE THE DIRECTORY PATH IN LINE 11	*
* NO OTHER CHANGES SHOULD BE NECESSARY.										*			
*****************************************************************************

* Directories
cd W:\Dropbox\Projects\2024\HBE_NonresponseOverTime\replication

******* Ensure required subfolders exist
cap mkdir data
cap mkdir temp
cap mkdir figs
cap mkdir tables
cap mkdir logs

******* Sets up the log for the output
local date : di  %tdCY-N-D  daily("$S_DATE", "DMY")
local h=substr(c(current_time),1,2)
local m=substr(c(current_time),4,2)
local s=substr(c(current_time),7,2)

cap log close
log using "logs/`date'-`h'-`m'-`s'", text

* System information
about 
ado dir

* Wrangle population target data from Statistics Iceland
noisily include 01_popdata.do

* Wrangle sample data from ICENES
noisily include 02_sampdata.do

* Create raking weights
noisily include 03_raking.do

* Calculate prediction error of raking weights
noisily include 04_prediction.do


log close


